package fun.codedesign.principle.deepjvm.oom.directOOM.reflect;


// import sun.misc.Unsafe;

// import java.lang.reflect.Field;

/**
 * 需要引入unsafee包
 */
public class DirectOOM {

    // private static final long _1MB = 1024 * 1024;

    // 直接内存溢出 NIO操作 Native Method
    public static void main(String[] args) throws Exception {
        // Field field = Unsafe.class.getDeclaredFields()[0];
        // field.setAccessible(true);
        // Unsafe unsafe = (Unsafe) field.get(null);
        // while (true) {
        //     unsafe.allocateMemory(_1MB);
        // }
    }
}
